#!/bin/sh

[[ $UID == 0 ]] || { echo "Must be root to run this script."; exit 0; }

INSTALL(){
	install -d /usr/libexec/
	install mlmonitor.py mlcommander.py /usr/libexec/
	install -m 0644 GNOME_MLMonitor_Factory.server /usr/lib/bonobo/servers/
	install -m 0644 mlnet_logo.png /usr/share/pixmaps
	echo "install successful."
}
UNINSTALL(){
	rm /usr/libexec/mlcommander.py /usr/libexec/mlmonitor.py
	rm /usr/lib/bonobo/servers/GNOME_MLMonitor_Factory.server
	rm /usr/share/pixmaps/mlnet_logo.png
	echo "uninstall successful."
}

case "$1" in
	"-i"|"--install")
		INSTALL
	;;
	"-u"|"--uninstall")
		UNINSTALL
	;;
	*)
		cat << EOF
Uasge: 
	run $0 -i to install
	run $0 -u to uninstall
EOF
	;;
esac
